// SPDX-License-Identifier: GPL-2.0
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/sizes.h>
#include <linux/platform_device.h>

MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:smc91x_dev");

/* Same defination as smc91x.c */
#define CARDNAME "smc91x"

int rx_vlan_opt;
EXPORT_SYMBOL(rx_vlan_opt);

static struct resource smc91x_resources[] = {
	[0] = {
		.name   = "smc91x-regs",
		.start  = 0x4E000000,
		.end    = 0x4E000000 + SZ_64K - 1,
		.flags  = IORESOURCE_MEM,
	},
	[1] = {
		.start  = 60,
		.end    = 60,
		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
	},
};

static struct platform_device smc91x_device = {
	.name = CARDNAME,
	.id = -1,
	.num_resources = ARRAY_SIZE(smc91x_resources),
	.resource = smc91x_resources,
};

static int __init smc91x_modules_init(void)
{
	return platform_device_register(&smc91x_device);
}

static void __exit smc91x_modules_exit(void)
{
	platform_device_unregister(&smc91x_device);
}

module_init(smc91x_modules_init);
module_exit(smc91x_modules_exit);
